package com.zzw.thread;

import java.util.concurrent.BlockingQueue;

public class Consum extends Thread {

	private BlockingQueue<String> bq;
	public Consum(BlockingQueue<String> bq){
		this.bq = bq;
	}
	
	public void run(){
		while(true){
			System.out.println(getName() + "");
			try {
				Thread.sleep(200);
				bq.take();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println(getName() + "" + bq);
		}
	}
}